
package fxbattle.fxgui;

import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import fxbattle.client.model.BattleMap;
import fxbattle.client.model.Location;
import fxbattle.client.model.BattleHex;
import fxbattle.client.model.Player;
import fxbattle.client.model.Army;
import javafx.scene.effect.DropShadow;
import fxbattle.client.model.Direction;
import java.lang.System;

def panelheight = 450;
def panelwidth = 500;
var map_var:BattleMap = new BattleMap();
def mapsize = 10;
for(x in [0..mapsize]){
    for(y in [0..mapsize]){
        if(x == 1 and y == 2){
        } else {
            map_var.setHex(new BattleHex(x, y));
        }
        if(y == 2){
            map_var.getHex(x,y).setElevation(x);
        }
        if(y == 0){
            var blarmy = new Army(Player.getPlayer("GREEN", java.awt.Color.GREEN), 30 * x);
            map_var.getHex(x, y).conquered(blarmy);
        }
    }
    map_var.assignNeighbors();
}

Stage {
    width : panelwidth
    height : panelheight + 12
    resizable: true
    title : "FxBattle"
    scene : Scene {
        fill : Color.WHITE
        content : [HexagonMap{
                map : map_var
                player: Player.getPlayer("GREEN", java.awt.Color.GREEN)
                effect: DropShadow {
                        offsetX: 10
                        offsetY: 7
                        color: Color.BLACK
                        radius: 25
                    }
                public override function toggleFlowPath(row: Integer, col: Integer, dir: Direction){
                    map_var.getHex(Location.getLocation(row, col)).toggleFlowPathActivity(dir);
                }
            }]
        }
}

println("Logging Location: {System.getProperty("java.util.logging.config.file")}");
